@model EIMS.Models.CustomerTransaction

@{
    ViewData["Title"] = "删除交易记录";
}

<div class="container-fluid px-4">
    <h1 class="mt-4">@ViewData["Title"]</h1>
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">首页</a></li>
        <li class="breadcrumb-item"><a asp-controller="Customer" asp-action="Index">客户管理</a></li>
        <li class="breadcrumb-item"><a asp-controller="Customer" asp-action="Details" asp-route-id="@Model.CustomerId">客户详情</a></li>
        <li class="breadcrumb-item active">删除交易记录</li>
    </ol>
    
    <div class="card mb-4">
        <div class="card-header">
            <i class="fas fa-exclamation-triangle me-1 text-danger"></i>
            确认删除交易记录
        </div>
        <div class="card-body">
            <div class="alert alert-danger">
                <h5>您确定要删除此交易记录吗？</h5>
                <p>此操作将永久删除该交易记录且无法恢复。</p>
            </div>
            
            <dl class="row">
                <dt class="col-sm-3">客户名称</dt>
                <dd class="col-sm-9">@Model.Customer.Name</dd>
                
                <dt class="col-sm-3">交易编号</dt>
                <dd class="col-sm-9">@Model.TransactionNumber</dd>
                
                <dt class="col-sm-3">交易类型</dt>
                <dd class="col-sm-9">@Model.Type</dd>
                
                <dt class="col-sm-3">交易日期</dt>
                <dd class="col-sm-9">@Model.TransactionDate.ToString("yyyy-MM-dd")</dd>
                
                <dt class="col-sm-3">金额</dt>
                <dd class="col-sm-9">¥ @Model.Amount.ToString("N2")</dd>
                
                <dt class="col-sm-3">付款状态</dt>
                <dd class="col-sm-9">
                    @if (Model.PaymentStatus == EIMS.Models.Enums.PaymentStatus.Paid)
                    {
                        <span class="badge bg-success">已付款</span>
                    }
                    else if (Model.PaymentStatus == EIMS.Models.Enums.PaymentStatus.PartiallyPaid)
                    {
                        <span class="badge bg-warning">部分付款</span>
                    }
                    else if (Model.PaymentStatus == EIMS.Models.Enums.PaymentStatus.Unpaid)
                    {
                        <span class="badge bg-danger">未付款</span>
                    }
                    else
                    {
                        <span class="badge bg-secondary">@Model.PaymentStatus</span>
                    }
                </dd>
            </dl>
            
            <form asp-action="DeleteTransactionConfirmed" method="post">
                <input type="hidden" name="id" value="@Model.Id" />
                <div class="form-group">
                    <button type="submit" class="btn btn-danger">
                        <i class="fas fa-trash"></i> 确认删除
                    </button>
                    <a asp-action="Details" asp-route-id="@Model.CustomerId" class="btn btn-secondary">
                        <i class="fas fa-arrow-left"></i> 返回
                    </a>
                </div>
            </form>
        </div>
    </div>
</div> 